package com.tanhua.server.controller;

import com.tanhua.server.service.SoundService;
import com.tanhua.server.vo.SoundVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/peachblossom")
public class SoundController {

    @Autowired
    private SoundService soundService;

    /**
     * 发送语音
     * @param soundFile
     * @return
     */
    @PostMapping
    public Object saveSound(@RequestParam("soundFile") MultipartFile soundFile) {
        return this.soundService.saveSound(soundFile);
    }

    /**
     * 查询语音
     * @return
     */
    @GetMapping
    public SoundVo querySound() {
        return this.soundService.querySound();
    }
}
